import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { cameraMonitorPlanCameraVO, cameraMonitorPlanCameraForm, cameraMonitorPlanCameraQuery } from '@/api/camera/camera-monitor-plan-camera/types';

/**
 * 查询监控预案-摄像机列表
 * @param query
 * @returns {*}
 */

export const listcameraMonitorPlanCamera = (query?: cameraMonitorPlanCameraQuery): AxiosPromise<cameraMonitorPlanCameraVO[]> => {
  return request({
    url: '/camera/camera-monitor-plan-camera/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询监控预案-摄像机详细
 * @param cameraMonitorPlanCameraId
 */
export const getcameraMonitorPlanCamera = (cameraMonitorPlanCameraId: string | number): AxiosPromise<cameraMonitorPlanCameraVO> => {
  return request({
    url: '/camera/camera-monitor-plan-camera/' + cameraMonitorPlanCameraId,
    method: 'get'
  });
};

/**
 * 新增监控预案-摄像机
 * @param data
 */
export const addcameraMonitorPlanCamera = (data: cameraMonitorPlanCameraForm) => {
  return request({
    url: '/camera/camera-monitor-plan-camera',
    method: 'post',
    data: data
  });
};

/**
 * 修改监控预案-摄像机
 * @param data
 */
export const updatecameraMonitorPlanCamera = (data: cameraMonitorPlanCameraForm) => {
  return request({
    url: '/camera/camera-monitor-plan-camera',
    method: 'put',
    data: data
  });
};

/**
 * 删除监控预案-摄像机
 * @param cameraMonitorPlanCameraId
 */
export const delcameraMonitorPlanCamera = (cameraMonitorPlanCameraId: string | number | Array<string | number>) => {
  return request({
    url: '/camera/camera-monitor-plan-camera/' + cameraMonitorPlanCameraId,
    method: 'delete'
  });
};
